<template>
  <div style="background:#f3f3f3">
    <header class="mint-header" style="font-size: 18px;">
      <div class="mint-header-button is-left">
        <button
          class="mint-button mint-button--default mint-button--normal"
          style="font-size: 15px;"
          @click="option"
        >
          <span class="mint-button-icon">
            <i class="mintui mintui-back" />
          </span>
          <label class="mint-button-text">返回</label>
        </button>
      </div>
      <h1 class="mint-header-title">维护记录</h1>
      <div class="mint-header-button is-right" />
    </header>
    <!-- <div style="height:40px"></div> -->
    <mt-search
      v-model="ep_ename"
      cancel-text="取消"
      placeholder="查询"
      @keyup.enter.native="loadListData"
    />
    <div>
      <div class="info-title">
        <span
          style="border-left:3px solid #000;padding-left:5px;display:inline-block;color:#000 !important"
        />
        <span style="display:inline-block;float:right;color:#26a2ff;" @click="addjilu">新增维护记录</span>
      </div>
      <div v-if="intermed.length==0">
        <img :src="zan" alt style="width:100%" />
        <div style="text-align:center;color:#35495e">暂无相关内容</div>
      </div>
      <div v-for="(item, index) in intermed" :key="index" v-else class="equi-div1">
        <div class="equi-left" style="margin-bottom:20px;">
          <h3 class="h3_equi">{{ item.hash.ep_ename }}</h3>
          <div class="equi-div" style="display:flex;color:#000;padding-left:5px;">
            <span class="equi-span2">维护时间：{{ item.hash.repair_time }}</span>
          </div>
          <div class="equi-div equi-gz">
            <span>
              维护内容：
              <span class="equi-span">{{ item.hash.repair_content }}</span>
            </span>
          </div>
          <div class="equi-div equi-gz">
            <span>
              <span class="equi-span2">维护人：{{ item.hash.username }}</span>
            </span>
          </div>
          <div class="equi-div equi-gz">
            <span>
              <span class="equi-span2">规格型号：{{ item.hash.scale }}</span>
            </span>
          </div>
          <div class="equi-div equi-gz">
            <span>
              <span class="equi-span2">管理编号：{{ item.hash.managenum }}</span>
            </span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  data() {
    return {
      intermed: [],
      ts: this.newStore(),
      zan: 'zanwu.png',
      ep_ename: '',
      htitle: '维护记录'
    }
  },
  created() {
    this.intermedlist()
  },
  methods: {
    intermedlist() {
      const req = {
        handle:
          'DD5D108B99FC12B735E83B084D0B700869B8AC1FA85E149EB0C68447069A54E9888636941D7FA35B',
        fzrid: localStorage.getItem('pid'),
        start: 0,
        limit: 10000000000000
      }
      this.spost(this.ts, '/mainservlet', req).then(ts => {
        if (ts.d.sflag == 'success') {
          this.intermed = ts.d.data.operation1
          console.log(this.intermed, 'this.intermed')
        }
      })
    },
    addjilu(item) {
      this.$router.push({
        name: 'addcartermed',
        query: { eid: item.eid, ep_ename: item.ep_ename }
      })
    },
    // 查询
    loadListData() {
      const req = {
        handle:
          'DD5D108B99FC12B735E83B084D0B700869B8AC1FA85E149EB0C68447069A54E9888636941D7FA35B',
        fzrid: localStorage.getItem('pid'),
        managenum: this.ep_ename,
        start: 0,
        limit: 10
      }
      this.spost(this.ts, '/mainservlet', req).then(ts => {
        if (ts.d.sflag == 'success') {
          this.intermed = ts.d.data.operation1
          console.log(this.intermed)
        }
      })
    },
    option() {
      this.$router.push({
        name: 'jbrhome',
        query: {
          name: ''
        }
      })
    }
  }
}
</script>
<style scoped>
.equi-div {
  font-size: 12px;
  line-height: 25px;
  color: #000;
}
.equi-shebei {
  display: inline-block;
  font-size: 12px;
  padding: 1px 5px;
  transform: scale(0.9);
  color: #fff !important;
  background: rgb(51, 51, 51);
}
.h3_equi {
  font-size: 16px;
  font-weight: 400;
  line-height: 40px;
}
.equi-gz {
  padding-left: 5px;
}
.equi-span2 {
  width: calc(calc(100% / 2) - 10px);
}
.equi-div1 {
  font-size: 16px;
  line-height: 25px;
  margin: 0 10px;
  text-align: left;
}
.equi-span {
  color: #000;
}
.equi-xq {
  line-height: 130px;
  /* padding-left: 20px; */
  color: #26a2ff;
  float: right;
  /* background: #ddd; */
  margin-top: 5px;
  padding-left: 10px;
  border-left: 1px solid #ddd;
}
.equi-left {
  width: 83%;
  float: left;
  padding-right: 0px;
  margin-right: 10px;
}
.mint-search {
  height: 7vh;
}
.mint-searchbar {
  background-color: #ddd;
}
</style>
